<!doctype html>
<html lang="en">
<head>
    @include('web.layout.head')
    <link rel="stylesheet" href="{{mix('/css/web/user/contract.css')}}">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
     @include('UEditor::head')  
</head>
<body>

@include('web.layout.header')
@include('web.layout.user_tab')
<div class="base_member_content">
    <div class="w1200">
        @include('web.layout.seller_nav')
        <div class="nav_right flr">
            <form action="{{$request_url}}" id="contracts_info" method="post">
            <div class="base_content fl">
            {{--<div class="contract_title">产 品 购 销 合 同</div>--}}
            <div class="contract_title">
                <input type="text" name="name" style="border: 0;" placeholder="例：产品购销合同 " value="{{isset($contracts['name'])?$contracts['name']:''}}">
                @if($errors->has('name'))
                    <span class="jm_error" style="display: inline;clear: both;">{{$errors->first('name')}}</span>
                @endif
            </div>
            <div class="contract_con">
                @if(isset($type) && $type == 'put')
                    {{method_field("PUT")}}
                @endif
                {!!  csrf_field() !!}
                <input type="hidden" name="id" value="{{old('id')}}" />

                <div class="contract_id_time">
                    <div class="contract_id fl contract_people">合同编号：
                        <span>
                            @if (isset($contracts['contracts_code']))
                                <input type="text" name="" value="{{$contracts['contracts_code']}}" style="border:0;" title="">
                            @else
                                <input type="text" name="" value="EPD49432548680342XE" style="border:0;" title="">
                            @endif
                        </span>
                    </div>
                    <div class="contract_time fr">日期：<span>@if (isset($contracts['created_at'])){{$contracts['created_at']}} @else {{ date('Y-m-d H:i:s',time()) }}@endif</span></div>
                    <div class="clear"></div>
                </div>
                <div class="contract_people">甲方：<input type="text" name="custom[name]"></div>
                <div class="contract_people">乙方：<input type="text" value="@if(isset($company['company_name'])){{$company['company_name']}}@else 杭州奥策科技有限公司 @endif" readonly=""></div>
               <!--  <div class="contract_word">经供货和采购双方友好协商，本着平等互利、协商一致的原则，签订如下购销合同，以资双方信守执行。</div> -->
              <!--   <div class="contract_table" >
                    <table>
                        <thead>
                            <tr>
                              <th width="80">序号</th>
                              <th width="150">品名</th>
                              <th width="150">品牌</th>
                              <th width="208">型号</th>
                              <th width="280">参数</th>
                              <th width="80">数量</th>
                              <th width="100">单价（元）</th>
                              <th width="150">合计（元）</th>
                            </tr>
                          </thead>
                        <tbody>
                            <tr>
                                <td colspan="8"><p class="text-center">系统将根据订单信息自动填。</p></td>
                            </tr>
                        </tbody>
                    </table>
                    <div class="table_total">
                        <span class="fl">合计：</span>
                        <span class="fr">元</span>
                    </div>
                </div> -->
                 <!--     <div class="contract_word">合同条例：</div> 

                    <div class="contract_prompt">
                    @if(!isset($contracts['content']))
                    <textarea name="content" title="" class="prompt">
1. 付款方式：货到付款，自签订合同之日起，开17%增值税发票。
2.收货地址 ：采购方指定货物签收人为:  宜昌市伍家岗三峡物流园，丁泽栋，158-7260-4075。
3.质量标准：原厂生产厂品，符合出厂标准及行业标准。
4.保修期：贰年。
5.运输方式及费用：供方承担发送货物的运输费用。因质量问题引起的退换货运输费用由供货方承担，其他问题引起的退换货运输费用由采购方承担。在供货方发出货物后一周内，采购方应将加盖公章的到货确认书原件邮寄或传真给供货方，如未能收到货物应书面通知供货方，否则视为采购方已收到货物。
6.技术服务：我公司免费提供电话、网络等全面的技术支持服务，如需现场指导，费用另计。
7.未尽事宜由双方友好协商解决，本合同双方签字，盖章后方可生效，合同生效后，双方必须严格履行。
8.本合同一式贰份，双方各执壹份，合同传真件具有同等法律效力。
              </textarea>
                    @else
                        <textarea name="content" title="" class="prompt">
{{$contracts['content']}}
              </textarea>
                    @endif
                    @if($errors->has('content'))
                        <span class="jm_error" style="display: inline;clear: both;">{{$errors->first('content')}}</span>
                    @endif
              </div>-->
              <div class="contract_word"> </div> 
              <div class="contract_prompt">
              <!-- <input type="hidden" name="content"  value="--"/>
               <textarea class="prompt" readonly="readonly"> 
               
               </textarea>-->
               
               <script class="prompt"  id="content" name="content"  style="min-height:300px;" type="text/plain"> </script> 
               </div>
                <div class="contract_st_box">
                    <div class="contract_seal_box fl">
                        <div class="seal_people">甲方：<input type="text" name="custom[name]"></div>
                        <div class="seal">（盖章）</div>
                    </div>
                    <div class="contract_seal_box fr">
                        <div class="seal_people">乙方：<span>@if(isset($company['company_name'])){{$company['company_name']}}@else 杭州奥策科技有限公司 @endif</span></div>
                        <div class="seal">（盖章）</div>
                    </div>
                </div>
            </div>
            <div class="btn_box">
                <button class="btn_confirm" type="submit">保存合同</button>
                <a href="{{asset('/member/seller/contracts')}}" class="btn_cancel fl">返回</a>
            </div>
            </div>
            </form>
            <div id="hcontent" style="display:none;">@if (isset($contracts['content'])) {!!$contracts['content']!!} @endif</div>
          </div>
      </div>
    </div>
@include('web.layout.footer')
<script type="text/javascript">
$(function(){
	  var ue_detail = UE.getEditor('content', {
	        toolbars: [
	            [
	                'fullscreen'  , 'bold', 'italic', 'underline', 'blockquote', '|',
	                'forecolor', 'backcolor', 'insertorderedlist', 'insertunorderedlist', '|',
	                'paragraph', 'fontfamily', 'fontsize', '|',
	                'justifyleft', 'justifycenter', 'justifyright', '|',
	                'link', 'unlink','horizontal', '|',
	            ]
	        ],
	        initialFrameHeight: 500,
	        initialFrameWidth: 948,
	        initialStyle:'p{font-size:10px; }'
	    });

	  ue_detail.ready(function() {
	        ue_detail.execCommand('serverparam', '_token', '{{ csrf_token() }}'); // 设置 CSRF token.
	        ue_detail.setContent($("#hcontent").html());
	    });
})
</script>
</body>
</html>